/**
 * @Author       : Mo 2427995270@qq.com
 * @Date         : 2025-04-23 22:08:10
 * @LastEditTime : 2025-05-28 18:05:38
 * @FilePath     : \KT-02CS-APP\bsp\FreeRTOSHook.c
 * @Description  : FreeRTOSHook
 * @Version      : V1.0
 * @History      : 
 * @Note         : 
 */
/***************************************Includes***********************************/
#include "FreeRTOS.h"
#include "task.h"
#include <stdlib.h>

/************************************Private Macros********************************/
//#define


/**********************************Private Statement*******************************/


/***********************************Public Variables*******************************/



/**********************************Private Variables*******************************/



/**********************************Public Functions********************************/

// clang-format off
#if ( configUSE_IDLE_HOOK == 1 )
    void vApplicationIdleHook(void) {
        // 喂狗
    }
#endif /* configUSE_IDLE_HOOK */


#if ( configCHECK_FOR_STACK_OVERFLOW > 0 )
    void vApplicationStackOverflowHook( TaskHandle_t xTask,
                                        char * pcTaskName )
    {
        /* Check pcTaskName for the name of the offending task,
         * or pxCurrentTCB if pcTaskName has itself been corrupted. */
        ( void ) xTask;
        ( void ) pcTaskName;
    }

#endif /* #if ( configCHECK_FOR_STACK_OVERFLOW > 0 ) */

#if ( configENABLE_HEAP_PROTECTOR == 1)
    void vApplicationGetRandomHeapCanary( portPOINTER_SIZE_TYPE * pxHeapCanary ) {
        // uint32_t seek = xTaskGetTickCount(); 不支持rand_r
        *pxHeapCanary = rand();
    }
#endif

// clang-format on
/**********************************Private Functions*******************************/


/* [] END OF FILE */
